package mysql

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Account  string `gorm:"type:varchar(20)"`
	Password string `gorm:"type:char(32)"`
	Phase    string `gorm:"type:varchar(11)"`
	Email    string `gorm:"type:varchar(50)"`
}

type Goods struct {
	gorm.Model
	Name   string  `gorm:"type:varchar(20)"`
	Price  float64 `gorm:"type:decimal(10,2)"`
	Image  string  `gorm:"type:varchar(255)"`
	Stock  int     `gorm:"type:int"`
	Status int     `gorm:"type:int"`
}

func (g *Goods) GoodsAdd() error {
	return DB.Debug().Create(g).Error
}
